<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ include file="../../pccommon.jsp"%>   
<!DOCTYPE html >
<html>
<head>
<c:set var="titleStr" value="${goodsQueryBean.keyWord}"></c:set>
<c:choose>
	<c:when test="${titleStr==null||titleStr==''}">
		<c:set var="titleStr" value="${goodsQueryBean.typeClassName}"></c:set>
	</c:when>
	<c:otherwise>
		<c:set var="titleStr" value="${titleStr}-商品搜索"></c:set>
	</c:otherwise>
</c:choose>
<c:if test="${titleStr==null||titleStr==''}">
	<c:set var="titleStr" value="${goodsQueryBean.goodsClassName}"></c:set>
</c:if>
<c:if test="${titleStr==null||titleStr==''}">
	<c:set var="titleStr" value="商品列表"></c:set>
</c:if>
<title>${titleStr}</title>
<link type="text/css" rel="stylesheet" href="${staticPath}/pccss/style.css" />
<link type="text/css" rel="stylesheet" href="${staticPath}/js/myPagination/css/page.css" />
<script type="text/javascript" src="${staticPath}/js/myPagination/js/jquery.myPagination.js"></script>
<script type="text/javascript" src="${staticPath}/js/app/goods/pclist.js"></script>
<style type="text/css">
<!--
a.curr{
	background: #eaeaea;
	width: 80px;
}
.asc{
	background: url(${staticPath}/images/up-blue.png) no-repeat;
	width: 13px;
	height: 12px;
	display: block;
	float:right;
	margin-top: 5px;
	*margin-top: -15px;
	margin-right: 5px;
	
}
.desc {
	background: url(${staticPath}/images/down-blue.png) no-repeat;
	width: 13px;
	height: 12px;
	display: block;
	float:right;
	margin-top: 5px;
	*margin-top: -15px;
	margin-right: 5px;
}
#filter a:hover{
	color:#2b5cb8;
}
.searchbutton{
	cursor: pointer;
}
.keyword_span{
	display: inline-block;
    margin: 4px 8px 0 0;
}
#condition{
    padding-left: 10px ;
}
-->
</style>
</head>
<body>
<div id="wrapper">
  <c:import url="../layout/header1.jsp?keyWord=${goodsQueryBean.keyWord}"></c:import>
  <!--head end-->
  <!--nav end-->
  <div id="mainlist">
     <div id="main" style="padding-top:20px;">
       <div class="mainlist11">
         <a href="<%=appPath%>/index.htm" target="_blank">首页 ${(goodsQueryBean.typeClass!=null&&goodsQueryBean.typeClass!='')?'&nbsp;>':''} </a>
         <c:if test="${goodsQueryBean.typeClass!=null&&goodsQueryBean.typeClass!=''}">
	         <a href="<%=appPath%>/goods/list.htm?typeClass=${goodsQueryBean.typeClass}&typeClassName=${goodsQueryBean.typeClassName}">${goodsQueryBean.typeClassName}</a>
         </c:if>
       </div>
       <div class="sortbox">	
	    <div class="siftbox clearfix">
		  <span class="label">已选条件:</span>
		  <div id="condition"></div>
	    </div>
	    <div id="filter">
	     <c:if test="${goodsClassList!=null&&(fn:length(goodsClassList)>0)}">
	         <dl class="clearfix" id="goodsClass_dl">
				<dt>分类：</dt>
				<c:forEach items="${goodsClassList}" var ="goodsClass">
					<dd><div><a href="javascript:void(0);" inputId="goodsClassId" dataValue="${goodsClass.id}" class="filter_a" >${goodsClass.name}</a></div></dd>
					<!-- 
					<dd><div><a>如果是一级进来显示二级</a></div></dd>
					<dd><div><a>如果没有分类 显示一级分类</a></div></dd>
					 -->
				</c:forEach>
			 </dl>
	     </c:if>
	     <c:if test="${brandGoodsClassList!=null&&(fn:length(brandGoodsClassList)>0)}">
			 <dl class="clearfix" id="brand_dl">
				<dt>品牌：</dt>
				<c:forEach items="${brandGoodsClassList}" var="brandGoodsClass">
					<dd><div><a href="javascript:void(0);" inputid="brandId" datavalue="${brandGoodsClass.brand.id}" class="filter_a">${brandGoodsClass.brand.name}</a></div></dd>
				</c:forEach>
			 </dl>
		 </c:if>
	     <c:if test="${goodsClassAttrList!=null&&(fn:length(goodsClassAttrList)>0)}">
			<c:forEach items="${goodsClassAttrList}" var="goodsClassAttr" varStatus="attrIndex">
			   <dl class="clearfix attrClass_dl">
				  <dt> ${goodsClassAttr.attr.name}：</dt>
				  <c:set var="temKey" value="attrClass${goodsClassAttr.attr.id}"></c:set>
				  	<c:forEach items="${attrValueMap[temKey]}" var="attr" >
						<dd><div><a href="javascript:void(0);" inputid="attrId${attrIndex.index}" datavalue="${attr.id}" class="filter_a">${attr.name}</a></div></dd>
				  	</c:forEach>
			      </dl>
			</c:forEach>
	     </c:if>
	    </div>
      </div>
       <div class="mainlist1">
         <h3>排序：</h3>
         <a href=""  class="sort_a" orderType ="desc" col="id"  >综合</a>
         <a href=""  class="sort_a" orderType ="desc" col="salenum" >销量</a>
         <a href=""  class="sort_a" orderType ="desc" col="price" >价格<i></i></a>
         <input type="hidden" id="goodsClassName" name="goodsClassName" value="${goodsQueryBean.goodsClassName}" />
         <input type="hidden" id="brandName" name="brandName" value="${goodsQueryBean.brandName}" />
         <input type="hidden" id="typeClassName" name="typeClassName" value="${goodsQueryBean.typeClassName}" />
         <form id="query_form">
	         <input type="hidden" id="sort_input" name="sort" value="${goodsQueryBean.sort}" />
	         <input type="hidden" id="goodsClassId" name="goodsClassId" value="${goodsQueryBean.goodsClassId}" />
	         <c:forEach items="${goodsQueryBean.attrIds}" var="attr" varStatus="attrIndex">
		         <input type="hidden" id="attrId${attrIndex.index}" name="attrIds[${attrIndex.index}]" value="${attr}" />
	         </c:forEach>
	         <input type="hidden" id="attrValue" name="attrValue" value="${goodsQueryBean.attrValue}" />
	         <input type="hidden" id=brandId name="brandId" value="${goodsQueryBean.brandId}" />
	         <input type="hidden" id="keyWord" name="keyWord" value="${goodsQueryBean.keyWord}" />
	         <input type="hidden" id="typeClass" name="typeClass" value="${goodsQueryBean.typeClass}" />
         </form>
         <input type="hidden" id="preGoodsClassId" value="${goodsQueryBean.goodsClassId}"/>
       </div>
       <div class="mainlist2" >
	       <div id="goods_list">
	       <%--
		       <c:forEach items="${pageResult.content}" var="goods">
		         <div class="mainlist3">
		           <div class="mainlist31"><a href="<%=appPath%>/goods/${goods.id}.htm" target="_blank"><img src="${goods.image}" /></a></div>
		           <div class="mainlist32">
		             <ul>
		               <li><a href="<%=appPath%>/goods/${goods.id}.htm" target="_blank">${goods.name}</a></li>
		               <li><h3>￥<fmt:formatNumber value="${goods.price/100}" pattern="0.00"/></h3><p>销量：${goods.salenum}</p></li>
		             </ul>
		           </div>
		         </div>
		       </c:forEach>
	        --%>
	       </div>
	     <div style="clear: both;"></div> 
        <div id="page_div"></div>
       </div>
     </div> 
  </div>

  <!--mainlist end-->
  <c:import url="../layout/footer.jsp"></c:import>
  <!-- footer end -->
</div>  
<script type="text/javascript">
	
	function RetSelecteds(){
		var result = "";
		$("#filter a[class='seled']").each(function(){
			result += $(this).html()+"\n";
		});
		return result;
	}
</script>
</body>
</html>
